package com.mano.mall.gateway.feign;

import com.mano.mall.api.dto.gatewayhandler.output.BlackListOutputDTO;
import com.mano.mall.api.gatewayhandler.BlackListService;
import com.mano.mall.common.base.BaseApiService;
import com.mano.mall.common.base.BaseResponse;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;

@FeignClient(value = "mano-mall-gatewayhandler",fallback = BlackListServiceFeignCallBack.class)
public interface BlackListServiceFeign extends BlackListService {
}

@Component
class BlackListServiceFeignCallBack extends BaseApiService implements BlackListServiceFeign{
    @Override
    public BaseResponse<BlackListOutputDTO> findBlacklist(String ipAddr) {
        return setResultError("服务器忙，请稍后重试");
    }
}